package io.ent.modules.mis.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import io.ent.common.annotation.DataFilter;
import io.ent.common.utils.Constant;
import io.ent.common.utils.PageUtils;
import io.ent.common.utils.Query;
import io.ent.modules.mis.dao.MisCustomerDao;
import io.ent.modules.mis.entity.MisCustomerEntity;
import io.ent.modules.mis.service.MisCustomerService;
import io.ent.modules.sys.service.SysDeptService;


@Service("misCustomerService")
public class MisCustomerServiceImpl extends ServiceImpl<MisCustomerDao, MisCustomerEntity> implements MisCustomerService {
	@Autowired
	private MisCustomerService misCustomerService;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String username = (String)params.get("username");
        IPage<MisCustomerEntity> page = null;

        page = this.page(
                new Query<MisCustomerEntity>().getPage(params),
                new QueryWrapper<MisCustomerEntity>()
                        .like(StringUtils.isNotBlank(username), "username", username).or().like(StringUtils.isNotBlank(username), "name", username)
        );
        
        return new PageUtils(page);
    }

}
